package org.example.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.example.api.TagApi;
import org.example.common.Result;
import org.example.model.Categories;
import org.example.model.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/tag")
public class TagController {

    @Reference(interfaceClass = TagApi.class, version = "1.0.0", check = false)
    private TagApi tagApi;

    @GetMapping("/list")
    @ApiOperation(value = "按照用户id查询标签列表")
    public Result<List<Tag>> queryAllTagByUserId(
            @ApiParam(value = "用户Id", required = true) @RequestParam Long userId
    ) {
        return tagApi.queryAllTagByUserId(userId);
    }
}
